import requests


class RegisterApi:
    @classmethod
    def registerapi(cls, regist_data,session) -> requests.Response():
        url = 'http://hmshop-test.itheima.net/Home/User/reg.html'
        headers = {"Contene-Type": "html/test; charset=UTF-8"}
        session.get('http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify&type=user_reg&r=0.7548167333829703')
        # regist_data = {
        #     "username": "15879441123",
        #     "verify_code": "8888",
        #     "password": "123456",
        #     "password2": "123456"
        # }
        r = session.post(url, headers=headers, data=regist_data)

        return r
        # assert 200 == r_reg.status_code
        # assert -1 == r_reg.json().get('status')
        # assert '请用手机号或邮箱注册' in r_reg.json().get('msg')


if __name__ == '__main__':
    ca = RegisterApi()
    print(ca.registerapi())
